package com.wf.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wf.context.BaseContext;
import com.wf.domain.RepairInfo;
import com.wf.service.RepairInfoService;
import com.wf.mapper.RepairInfoMapper;
import org.springframework.stereotype.Service;

/**
* @author mpk16
* @description 针对表【repair_info】的数据库操作Service实现
* @createDate 2024-08-28 13:32:50
*/
@Service
public class RepairInfoServiceImpl extends ServiceImpl<RepairInfoMapper, RepairInfo>
    implements RepairInfoService{

    @Override
    public boolean insertRepair(RepairInfo repairInfo) {

        //设置用户id
        repairInfo.setUserId(BaseContext.getCurrentId());
        //设置默认状态
        repairInfo.setRepairStatus(0);
        //报修
        repairInfo.setCode(RandomUtil.randomString(8));

        return this.save(repairInfo);

    }
}




